home *** CD-ROM | disk | FTP | other *** search
- /*
- * DragX.h
- *
- * Copyright © 1995-96 Marco Piovanelli <mailto:piovanel@kagi.com>
- * All Rights Reversed
- */
-
-
- #pragma once
-
- #ifndef __DEVICES__
- #include <Devices.h>
- #endif
-
- #ifndef __FILES__
- #include <Files.h>
- #endif
-
- #ifndef __RESOURCES__
- #include <Resources.h>
- #endif
-
- #ifndef __ERRORS__
- #include <Errors.h>
- #endif
-
- #ifndef __TEXTEDIT__
- #include <TextEdit.h>
- #endif
-
- #ifndef __COMPONENTS__
- #include <Components.h>
- #endif
-
- #ifndef __TRANSLATIONEXTENSIONS__
- #include <TranslationExtensions.h>
- #endif
-
- #ifndef __DRAG__
- #include <Drag.h>
- #endif
-
- const FourCharCode kDragXSignature = 'DrgX' ;
- const UInt32 kDragXVersion = 0 ;
- const UInt32 kMinHFSFlavorSize = 17 ;
-
- enum
- {
- flavorTypeText = 'TEXT' ,
- flavorTypeTextStyles = 'styl' ,
- flavorTypeStyledText = 'stxt'
- } ;
-
- struct GlobalsRecord
- {
- OSType signature ; // record signature; must be kDragXSignature
- ComponentInstance instance ; // component instance
- } ;
- typedef struct GlobalsRecord * GlobalsPtr ;
- typedef struct GlobalsRecord * const GlobalsPtrConst ;
-
- struct DragXScrapTranslationList
- {
- ScrapTranslationList header ; // modification time & group count
- long srcCount ; // number of source types (= 1)
- Size srcEntrySize ; // must be sizeof ( ScrapTypeSpec )
- ScrapTypeSpec srcSpec [ 1 ] ; // source type spec
- long dstCount ; // number of destination types (= 1)
- Size dstEntrySize ; // must be sizeof ( ScrapTypeSpec )
- ScrapTypeSpec dstSpec [ 1 ] ; // destination type spec
- } ;
-
- // component entry point
- pascal ComponentResult main ( ComponentParameters * params, Handle globals ) ;
-
- // common Component Manager selectors
- pascal ComponentResult DragX_CanDo ( GlobalsPtr g, SInt16 selector ) ;
- pascal ComponentResult DragX_Open ( GlobalsPtr g, ComponentInstance self ) ;
- pascal ComponentResult DragX_Close ( GlobalsPtr g, ComponentInstance self ) ;
-
- // selectors for scrap translation extensions
- pascal ComponentResult DragX_GetScrapTranslationList ( GlobalsPtr g, Handle list ) ;
- pascal ComponentResult DragX_IdentifyScrap ( GlobalsPtr g, const void * dataPtr, Size dataLength, ScrapType * dataFormat ) ;
- pascal ComponentResult DragX_TranslateScrap ( GlobalsPtr g, TranslationRefNum refNum, const void * srcDataPtr, Size srcDataSize, ScrapType srcType, long srcTypeHint, Handle dstData, ScrapType dstType, long dstTypeHint ) ;
-
- // utility routines
- void BlockClear ( void * blockPtr, Size blockSize ) ;
-